home *** CD-ROM | disk | FTP | other *** search
/ AEMail 2.40 / AEMail v2.40.iso / arexx / html2.readme < prev    next >
Text File  |  2000-03-11  |  10KB  |  249 lines

  1. html2.readme
  2.  
  3. THIS SCRIPT WILL RUN ON BOTH REGISTERED AND UNREGISTERED COPIES OF AEMAIL
  4.  
  5. The html2.aem script, like the html.aem script, is used to read html
  6. attachments in email or to display a web address contained within a
  7. message.  The difference between html.aem and html2.aem is that html2.aem
  8. will allow you to select the browser you want to use if you have multiple
  9. browsers.
  10.  
  11. You can also assign this script to the Web Addr exit to select your browser
  12. without bringing up the clip window when you double click on a web address
  13. embedded in the message.
  14.  
  15. The html2.aem script is currently set up to select between IBrowse 1.x,
  16. Ibrowse 2.x, and AWeb3.  The reason both IBrowse 1.x and IBrowse 2.x are
  17. specified is that IBrowse 2.x lacks some of the features of IBrowse 1.x
  18. but includes additional features like JAVA script.
  19.  
  20. It can also be attached to a function key or a menu item and used to
  21. activate your browser to display a web address that is contained within a
  22. message.
  23.  
  24. The script requires the "rexxsupport.library" to run.  This library
  25. normally comes with your Amiga at version 2.1 or greater.
  26.  
  27. When first activated the script displays a list of browsers that you might
  28. want to use.  The default list looks like this:
  29.  
  30.     IBROWSE2
  31.     IBROWSE1
  32.     AWEB3
  33.  
  34. You can modify this list by changing the line beginning with "browlst ="
  35. in the script to include the browsers you want.  You will also have to
  36. modify the IF ...  ELSE sequence that establishes the directory (wwwdir),
  37. program (wwwprog), and ARexx port (wwwport) for any selected browser (see
  38. below under "HOW TO IMPLEMENT").
  39.  
  40. When reading HTML attachments, the script uses your browser to read the
  41. HTML file.  This script can use either IBrowse or AWeb to read and display
  42. the html document.  The script will have to be modified to use a different
  43. browser.
  44.  
  45. Also in this directory is an alternate mailcap file which is required for
  46. displaying the html document.  You will notice in the mailcap file the
  47. first line which is as follows:
  48.  
  49.     text/html; "run >NIL: rx html.aem %s"
  50.  
  51. This line calls the html.aem script to display the html attachment with
  52. your browser.  To use the mailcap, the script, "html2.aem", should be
  53. moved to your REXX:  directory and renamed "html.aem".  Notice that the
  54. call line says "run".  This is required to allow the script to become
  55. detached from AEMail so that ARexx commands can be directed back to
  56. AEMail.  If the "run" is not present, AEMail will become frozen when you
  57. attempt to display the document.
  58.  
  59. You can move this mailcap to your mail directory when you install AEMail
  60. (if you install at the "expert" level) or, using the Viewer page of the
  61. Configuration screen, you can create a "text/html" statement in your
  62. mailcap.  If you use the Viewer page, you do not have to move the script to
  63. the REXX: directory since you can specify the full path name in the rexx
  64. script call.  In this case you can specify AEMail2:AEMail/ARexx/html2.aem
  65.  
  66.                              HOW TO IMPLEMENT
  67.                              ----------------
  68.  
  69. Copy the mailcap file over your existing mailcap file or create a mailcap
  70. entry for "text/html" in your mailcap using the Viewer page of the
  71. Configuration Setup Window.
  72.  
  73. Move the html2.aem script to either your program directory or the REXX:
  74. directory and rename it "html.aem".  If you create your own mailcap with
  75. the Viewer page of the Configuration Setup, you can create a line for:
  76.  
  77.     text/html
  78.  
  79. and locate the "html2.aem" ARexx script using the file requester in
  80. AEMail's ARexx drawer.  Be sure the full path is specified.  If you do
  81. this you do not have to move the html2.aem script.
  82.  
  83. The script is designed specifically for IBrowse or AWeb and must be
  84. modified if another browser is used.
  85.  
  86. At the beginning of the script you will notice the section beginning:
  87.  
  88.     IF (file = "") THEN DO
  89.  
  90. this is used to pick up the variable (the GETVAR statement) that is the URL
  91. when you are activating a web address embedded in a message.  If you are
  92. reading an HTML attachment, the local file address used is passed to the
  93. script so that "file" will not be empty which bypasses these statements.
  94.  
  95. Since IBrowse doesn't normally create an assignment for it's program
  96. directory, you will have to add an assignment for the IBrowse program
  97. directory to your startup sequence.  If you are using both IBrowse 1.x and
  98. IBrowse 2.x, the assignments could be IBROWSE1 for the IBrowse 1.x
  99. directory and IBROWSE2 for the IBrowse 2.x directory.
  100.  
  101. Note, however, that the assignment for AWeb3 is all in upper case letters.
  102. Even though the assign statement specifies upper and lower case letters,
  103. you have to specify the assign with all caps for ARexx to properly find
  104. it.
  105.  
  106. If you wish to use another browser, you will have to modify the browlst =
  107. statement and add an ASSIGN for that browser's program directory.  Then
  108. add the following statements:
  109.  
  110.     IF browser = "xxxxx" THEN
  111.         DO
  112.         wwwdir = "xxxxx"
  113.         wwwprog = "xxxxx:prog"
  114.         wwwport = "ppppp"
  115.         END
  116.  
  117. where xxxxx is the name used in your ASSIGN and in the browlst =
  118. statement, prog is the name of your browser program, and ppppp is the
  119. ARexx prort for that browser.
  120.  
  121. The section of the script that begins with
  122.  
  123.     IF (wwwport = "AWEB." THEN
  124.  
  125. is used to obtain the port number for AWEB.  If you are using AWeb and AWEB
  126. is not running this will default to AWEB.1
  127.  
  128. The section beginning:
  129.  
  130.     IF ~ SHOW('P', wwwport) THEN
  131.  
  132. is used to load your browser if is not already loaded.
  133.  
  134. The line:
  135.  
  136.     olddir = PRAGMA('D', wwwdir)
  137.  
  138. is used to change the directory to the directory containing your program.
  139. This is necessary with some browsers (especially IBROWSE) so that they can
  140. find the modules and files they need.  IBROWSE gurus in some instance if
  141. this statement is not there.
  142.  
  143. The section beginning:
  144.  
  145.     IF (file2 == 'T:AMtemp') THEN DO
  146.  
  147. is used to set up the URL call for a local file if the file name "T:AMtemp"
  148. is passed to the script.  This is the standard name and place AEMail uses
  149. for temporarily storing attachment files.  The name must be changed to
  150. t:amtemp.html since browsers require the .html suffix on the name.  The
  151. full call that browsers use is:
  152.  
  153.     "file://localhost/t:amtemp.html"
  154.  
  155. which is stored in the variable "file".
  156.  
  157. The final part of the script:
  158.  
  159.  
  160.     ADDRESS VALUE wwwport
  161.  
  162.     IF (wwwport = "IBROWSE") THEN DO
  163.         "INFO SCREEN"
  164.         ADDRESS AEMAIL1 SCREENTOFRONT result
  165.         "GOTOURL" file
  166.         END
  167.     ELSE DO
  168.         "SCREENTOFRONT"
  169.         "OPEN" file
  170.         END
  171.  
  172. causes things to happen a bit differently if you are running IBROWSE versus
  173. AWEB.  The statement:
  174.  
  175.     ADDRESS VALUE wwwport
  176.  
  177. sets your ARexx port to the correct port name.  If the port was "IBROWSE"
  178. then this action takes place:
  179.  
  180.  
  181.     "INFO SCREEN"
  182.  
  183. This obtains the public screen name for your browser.  Since IBROWSE uses
  184. MUI, this is a standard stament for any program using MUI.  The next
  185. statement:
  186.  
  187.     ADDRESS AEMAIL1 SCREENTOFRONT result
  188.  
  189. is a call to AEMail to switch your browser's screen to the front.  "result"
  190. is the screen named obtained through MUI of the browser's public screen.
  191.  
  192. The statement:
  193.  
  194.     "GOTOURL" file
  195.  
  196. is an ARexx call to IBROWSE to display the html document.
  197.  
  198. If your browser is not IBROWSE, then it is assumed to be AWEB.  The
  199. statements after ELSE are used for AWEB.  Since AWEB does not use MUI, it
  200. has its own statement for bring the AWEB screen to the front.  This is:
  201.  
  202.     "SCREENTOFRONT"
  203.  
  204. Then the call to AWEB to display your URL is "OPEN" rather than "GOTOURL"
  205.  
  206.  
  207.                                 HOW TO USE
  208.                                 ----------
  209.  
  210. When you get an email with an html attachment (or text body) call up your
  211. attachment requester, select the appropriate attachment (it will say
  212. "text/html"), and click on VIEW.  Select the browser that you want called
  213. that is listed in the listview display.  Your browser will be loaded (if
  214. it is not already loaded) and the page will be displayed.  You should have
  215. an open connection to your Internet server when you call your browser
  216. since many html attachments obtain information over the internet (such as
  217. graphic images).
  218.  
  219. When you are done viewing the html document you should either close the
  220. browser or switch it's screen to the back to re-display the AEMail screen.
  221.  
  222. For browsers that open on the Workbench, there is an AREXX script called
  223. AEMAIL_TOFRONT.aem.  This script will automatically close your browser and
  224. bring the AEMail screen to the front (see the AEMAIL_TOFRONT.readme) and
  225. must be installed in the AREXX portion of your browser.
  226.  
  227. To use this script to display embedded web addresses in a document you
  228. will have to bind the "html2.aem" script to a function key in AEMail and
  229. assign a menu title.  To do this call up the ARexx page of the AEMail
  230. configuration screen and select the function key you want the "html2.aem"
  231. script bound to.  Enter the script name (full path name) in the string
  232. gadget.  Be sure you have AREXX selected in the cycle gadget.  You can use
  233. the file folder glyph to call up the file requester to locate the script.
  234. Then, if you want a menu item, enter a menu title in the "Menu Title"
  235. string gadget.  Then save the configuration.
  236.  
  237. When you receive a message with an embedded web address just double click
  238. on the line containing the web address.  The web address will appear in
  239. the Clip window.  Now either hit the function key that you bound the
  240. html.aem script to or select the menu item indicate by the "Menu Title"
  241. and the web page will be called up.  You will, of course, have to be
  242. connected to your Internet provider for this to work.
  243.  
  244. If for any reason your browser can not be loaded, multiview will be called
  245. to display the document as a text document.
  246.  
  247.  
  248.  
  249.